<?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', true);
date_default_timezone_set('Europe/London');

$rootDir = dirname(dirname(__FILE__));
set_include_path($rootDir . '/library' . PATH_SEPARATOR . get_include_path());

//require_once 'Zend/Loader.php';
//Zend_Loader::loadClass('Zend_Debug');
//Zend_Loader::loadClass('Zend_Controller_Front');
//Zend_Loader::LoadClass('Zend_view');
//Zend_Loader::registerAutoload();

require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->setFallbackAutoloader(true);

defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
require_once 'Zend/Layout.php';
Zend_Layout::startMvc(array('layoutPath' => APPLICATION_PATH.'/views/layouts'));

// load configuration
$section = getenv('PLACES_CONFIG') ? getenv('PLACES_CONFIG') : 'live';
$config = new Zend_Config_Ini('../application/config.ini', $section);
//echo $config->db->config->dbname;
Zend_Registry::set('config', $config); 

$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->setControllerDirectory('../application/controllers');

$frontController->dispatch();


?>